#version 130
precision highp float;
in vec2 InterpolatedColor;
out vec4 glColor;
in vec2 qt_TexCoord0;
uniform int iType;


void main(void)
{
    const int TERRE = 1;
    const int BOIS = 2;
    const int PIERRE = 3;
    const int SABLE = 4;
    const int EAU = 5;
    const int LAVE = 6;
    switch (iType) {
      case TERRE:
	if (InterpolatedColor.y<0.2) {
            glColor = vec4( 0.0f, 102.0f/255.0f, 0.0f , 1.0) ;
        } else {
            glColor = vec4( 102.0f/255.0f, 51.0f/255.0f, 0.0f , 1.0) ;
        }
      break;
      case BOIS:
	glColor = vec4(204.0/255, 102.0/255, 0.0, 1.0) ;
      break;
      case PIERRE:
	glColor = vec4( 0.3, 0.3, 0.3, 1.0) ;
      break;
      case SABLE:
	glColor = vec4( 1.0, 1.0, 0.0, 1.0) ;
      break;
      case EAU:
	glColor = vec4( 0.0, 0.0, 1.0, 1.0) ;
      break;
      case LAVE:
	glColor = vec4( 1.0, 0.0, 0.0, 1.0) ;
      break;
      default:
	glColor = vec4( 1.0, 1.0, 1.0, 1.0) ;

    }
//  vec3 pos = normalize(MCposition) ;

  //glColor = InterpolatedColor;
}
